/*
 * Copyright 2011-2020 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0.
 * See `LICENSE` in the project root for license information.
 */

package me.ijleex.mgmt.system.role.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;

import me.ijleex.mgmt.framework.mybatis.mapper.MyBatisMapper;
import me.ijleex.mgmt.system.role.entity.Role;

/**
 * 用户角色 数据层
 *
 * @author liym
 * @since 2019-03-14 11:19:03 By 'codegen'
 */
@Mapper
public interface RoleMapper extends MyBatisMapper<Role> {

    /**
     * 查询已授权给指定用户的角色的列表
     * <p/>
     * see UserRoleMapper#selectRoleIdByUserId(Long)
     *
     * @param userId 用户ID
     * @return 角色列表
     * @since 2019-03-14 11:38
     */
    List<Role> selectByUserId(Long userId);

    /**
     * 根据角色名查询角色ID
     *
     * @param name 角色名
     * @return 角色ID
     */
    Long selectIdByName(String name);

}
